﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Text;

namespace LiteBlog.Models
{
    public class UserModel
    {
        public string Name { get; set; }
        public bool Authenticated { get; set; }

        public UserModel() { }
        public UserModel(string name, bool authenticated)
        {
            this.Name = name;
            this.Authenticated = authenticated;
        }

        public UserModel(IPrincipal principal)
        {
            if (principal != null)
            {
                this.Name = principal.Identity.Name;
                this.Authenticated = principal.Identity.IsAuthenticated;
            }
        }
    }
}
